package com.embhealth.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.embhealth.constant.MessageConstant;
import com.embhealth.constant.RedisConstant;
import com.embhealth.entity.LogException.DeleteAddressException;
import com.embhealth.entity.PageResult;
import com.embhealth.entity.QueryPageBean;
import com.embhealth.entity.Result;
import com.embhealth.pojo.Address;
import com.embhealth.pojo.CheckItem;
import com.embhealth.pojo.Setmeal;
import com.embhealth.service.AddressService;
import com.embhealth.service.CheckItemService;
import com.embhealth.utils.QiniuUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import redis.clients.jedis.JedisPool;

import java.io.IOException;
import java.util.List;
import java.util.UUID;

/**
 * 体检机构管理
 */
@RestController
@RequestMapping("/address")
public class AddressController {

    @Reference
    private AddressService addressService;
    @Autowired
    private JedisPool jedisPool;
    
    /**
     * 查询所有的体检机构地址信息
     * @return
     */
    @RequestMapping("findAllAddress")
    public Result findAllAddress(){
        try {
            List<Address> addresses =addressService.findAllAddress();
            return new Result(true,MessageConstant.EDIT_ADDRESS_SUCCESS,addresses);
        }catch (Exception e){
            e.printStackTrace();
            return new Result(false,MessageConstant.EDIT_ADDRESS_FAIL);
        }
    }
    
}
